﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Business.Compta;

namespace Manageo
{
    /// <summary>
    /// Interaction logic for Window1.xaml
    /// </summary>
    public partial class Window1 : Window
    {
        public Window1()
        {            
                InitializeComponent();
                Login l = new Login();
                this.MainPanel.Content = l;
                l.ConnectBtn.Click += new RoutedEventHandler(ConnectBtn_Click);
        }

        void ConnectBtn_Click(object sender, RoutedEventArgs e)
        {
            Login login = (Login)this.MainPanel.Content;
            if (login.SelectedUser.SelectedValue!=null)
                this.MainPanel.Content = new MainForm((User)login.SelectedUser.SelectedValue); ;
        }

        private void Window_MouseEnter(object sender, MouseEventArgs e)
        {
            this.Opacity = 1;
        }

        private void Window_MouseLeave(object sender, MouseEventArgs e)
        {
            this.Opacity = 0.5;
        }
    }
}
